TableTrack WhatsApp Module

Compatible with TableTrack v1.2.1 and above

This is an add-on module that works exclusively with the TableTrack application. To purchase TableTrack, please visit TableTrack on CodeCanyon

Latest Version

Released: January 2026

Support

Get Help

Description

WhatsApp Business API Integration Module enables restaurants to send automated WhatsApp notifications to customers, restaurant admins, staff, and delivery executives. This module integrates seamlessly with TableTrack's existing event system to send 29 different types of notifications via WhatsApp Business API.

The module provides a complete notification system that includes:

  • 29 Predefined Notification Templates organized by recipient type (Customer: 11, Admin: 5, Staff: 9, Delivery: 3, Automated: 1)
  • Event-Driven Notifications that automatically trigger when orders, reservations, payments, and other events occur
  • Template Management System for easy template creation and mapping to WhatsApp Business Portal templates
  • Admin Panel for configuration, template management, and notification preferences
  • Notification Logging to track all sent notifications with delivery status
  • Multi-language Support for templates
  • Automated Scheduling for reports, reminders, and follow-ups

The module ensures compliance with WhatsApp Business API policies and handles template approval workflows, webhook configuration, and delivery status tracking.

System Requirements

  • PHP >= 8.2.0
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML & GD PHP Extensions

Installation Guide

Step 1: Enable Module

php artisan module:enable Whatsapp

Step 2: Run Migrations

php artisan module:migrate Whatsapp

Step 3: Seed Template Definitions

php artisan db:seed --class="Modules\Whatsapp\Database\Seeders\WhatsAppTemplateDefinitionsSeeder"

Step 4: Configure WhatsApp Business API

  1. Go to Superadmin PanelSettingsWhatsApp Settings
  2. Enter your WhatsApp Business API credentials:
    • WABA ID (WhatsApp Business Account ID)
    • Access Token (encrypted storage)
    • Phone Number ID
    • Business Phone Number
  3. Test connection and enable WhatsApp

Step 5: Create Templates on Meta Business Manager

  1. Go to Meta Business Manager → Message Templates
  2. Create the required templates (see Template Library in admin panel for JSON structures)
  3. Wait for WhatsApp approval (24-48 hours)

Step 6: Map Templates and Enable Notifications

  1. Go to Admin PanelSettingsWhatsApp Notifications
  2. Map notification types to your WhatsApp template names
  3. Enable notifications you want to use
  4. Configure schedules for automated notifications if needed

Setup Guide

WhatsApp Business API Configuration

To use WhatsApp notifications, you need to configure your WhatsApp Business API credentials and set up webhooks for delivery status tracking.

1. Get WhatsApp Business API Credentials

  1. Create a WhatsApp Business Account on Meta Business Manager
  2. Get your WABA ID (WhatsApp Business Account ID)
  3. Generate an Access Token with appropriate permissions
  4. Get your Phone Number ID
  5. Note your Business Phone Number

2. Configure Webhook

Webhook is required to receive delivery status updates from Meta:

  1. Get your public webhook URL (must be HTTPS):
    • Production: https://yourdomain.com/api/whatsapp/webhook
    • Development: Use ngrok or similar: https://your-ngrok-url.ngrok.io/api/whatsapp/webhook
  2. Go to Meta Business ManagerWhatsAppConfigurationWebhooks
  3. Click "Edit" or "Add webhook"
  4. Enter your webhook URL
  5. Enter verify token (check database: whatsapp_settings.verify_token)
  6. Subscribe to events:
    • messages (incoming messages)
    • message_status (delivery status updates)
  7. Click "Verify and save"

3. Test Account Setup (For Development)

If using a test account, add phone numbers to allowed recipient list:

  1. Go to Meta Business ManagerWhatsAppPhone Numbers
  2. Click on your phone number
  3. Go to "Phone number settings""Manage phone number"
  4. Scroll to "Test phone numbers" or "Allowed recipient list"
  5. Add recipient phone numbers (format: 919784921431 - no + sign, no spaces)
  6. Save changes

4. Template Creation Workflow

  1. Go to Admin PanelSettingsWhatsApp NotificationsTemplate Library
  2. View template JSON for each notification type
  3. Copy template JSON
  4. Go to Meta Business ManagerMessage Templates
  5. Create template with same name (e.g., order_confirmation)
  6. Paste JSON and submit for approval
  7. Wait for approval (24-48 hours)
  8. Return to Template Mapping page
  9. Map notification type to WhatsApp template name
  10. Activate notification type

5. Queue Configuration

If using database queue driver, ensure queue worker is running:

php artisan queue:work

Or add to cron for production:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

WhatsApp module is ready to use. Configure your WhatsApp Business API credentials and templates to start sending notifications.

Key Features:

  • 29 predefined notification templates covering all restaurant operations
  • Event-driven notifications automatically sent when orders, reservations, and payments occur
  • Complete notification logging with delivery status tracking
  • Automated scheduling for reports, reminders, and follow-ups
  • Compliance with WhatsApp Business API policies and template requirements

Automated Commands

The module includes several scheduled commands for automated notifications:

Process Automated Schedules:

php artisan whatsapp:process-automated-schedules

Process Report Schedules:

php artisan whatsapp:process-report-schedules

Process Payment Reminders:

php artisan whatsapp:process-payment-reminders

Process Reservation Reminders:

php artisan whatsapp:process-reservation-reminders

Process Reservation Followups:

php artisan whatsapp:process-reservation-followups

Notification Templates

The WhatsApp module includes 29 predefined notification templates organized by recipient type. Each template can be customized and mapped to your WhatsApp Business Portal templates.

Customer Notifications (11 Templates)

Template Name Purpose Key Variables
order_confirmation New order confirmation Customer name, Order number, Order type, Total amount, Estimated time
order_status_update Order status changes (confirmed/preparing/ready/delivered) Order number, Status, Status message, Estimated time
order_cancelled Order cancellation notification Order number, Cancellation reason, Refund status
order_bill_invoice Bill/invoice after order completion Order number, Bill amount, Payment method, Bill link
payment_confirmation Payment success confirmation Order number, Payment amount, Transaction ID, Payment date
payment_reminder Payment due reminder Order number, Due amount, Due date, Payment link
reservation_confirmation Table booking confirmation Reservation date, Time, Number of guests, Table number
reservation_reminder Pre-reservation reminder Reservation date, Time, Time until reservation
reservation_status_update Reservation status changes Reservation ID, Status, Status message, New date/time
waiter_request_acknowledgment Waiter request acknowledgment Table number, Request time, Estimated wait time
table_ready_notification Table ready notification Table number, Reservation time, Arrival instructions

Admin Notifications (5 Templates)

Template Name Purpose Key Variables
new_order_alert New order alert Order number, Order type, Customer name, Total amount
sales_report Daily/weekly/monthly sales reports Report period, Total sales, Total orders, Average order value
low_inventory_alert Low stock alert Item name(s), Current stock, Minimum threshold
subscription_expiry_reminder Subscription expiry reminder Current plan, Expiry date, Days remaining, Renewal link
new_restaurant_signup New restaurant signup (superadmin) Restaurant name, Owner name, Email, Phone, Plan selected

Staff Notifications (9 Templates)

Template Name Purpose Key Variables
new_kot_notification New KOT for kitchen KOT number, Order number, Items list, Special instructions
order_modification_alert Order modification alert KOT number, Modification type, Changes details
order_cancellation_alert Order cancellation (kitchen) KOT number, Cancellation reason, Cancelled items
waiter_request Waiter request notification Table number, Request type, Request time
table_assignment Table assignment to waiter Waiter name, Table number, Customer name, Number of guests
order_ready_to_serve Order ready to serve Table number, Order number, Items ready
payment_request_alert Payment request alert Table number, Order number, Customer name
table_status_change Table status change Table number, Previous status, New status
daily_operations_summary Daily summary for managers Total orders, Total revenue, Staff on duty, Peak hours

Delivery Notifications (3 Templates)

Template Name Purpose Key Variables
delivery_assignment Delivery assignment Order number, Customer details, Pickup/Delivery address, Order items
order_ready_for_pickup Order ready for pickup Order number, Pickup address, Ready time, Customer details
delivery_completion_confirmation Delivery completion Order number, Delivery time, Delivery address, Payment status

Automated Reminders (1 Template)

Template Name Purpose Key Variables
reservation_followup Post-reservation follow-up Reservation date, Feedback link, Discount offer

Troubleshooting

Common Issues and Solutions

Issue 1: Messages "Accepted" But Not Delivered

Symptoms:

  • Messages show status "accepted" or "sent"
  • No "delivered" status updates received
  • Recipients not receiving messages

Possible Causes:

  1. Test Account Restriction: Phone numbers not in allowed recipient list
    • Go to Meta Business Manager → WhatsApp → Phone Numbers
    • Add recipient numbers to "Test phone numbers" list
    • Format: 919784921431 (no + sign, no spaces)
  2. Webhook Not Configured: Not receiving delivery status updates
    • Configure webhook in Meta Business Manager
    • Subscribe to message_status events
    • Verify webhook URL is publicly accessible (HTTPS)
  3. User Opt-In Issues: Users haven't explicitly consented
    • Ensure users explicitly opted-in to receive messages
    • Users should send you a message first (opens 24-hour window)
    • Document consent records
  4. Account Quality Rating: Low quality rating causes delivery blocks
    • Check quality rating in Meta Business Manager
    • Improve messaging practices to raise rating

Issue 2: Error Code 131030 - Recipient Not in Allowed List

Solution: Add phone number to test recipient list in Meta Business Manager

Issue 3: Error Code 10 - Application Does Not Have Permission

Solution: Template format mismatch (e.g., sales_report needs DOCUMENT format in header)

Update template in Meta Business Manager to match expected format

Issue 4: Notifications Not Sending

Checklist:

  • ✅ WhatsApp is enabled in superadmin panel
  • ✅ Credentials are correct and valid
  • ✅ Templates are approved on Meta (24-48 hours)
  • ✅ Notification is enabled in admin panel
  • ✅ Queue worker running (if using database queue)
  • ✅ Users have valid phone numbers

Issue 5: Scheduled Commands Not Running

Checklist:

  • ✅ Verify cron is running: php artisan schedule:list
  • ✅ Check schedule is enabled in admin panel
  • ✅ Verify scheduled time/day is correct
  • ✅ Check Laravel logs for errors

Message Status Flow

  1. "accepted" → Message accepted by API (queued)
  2. "sent" → Message sent to WhatsApp servers
  3. "delivered" → Message delivered to device ✅
  4. "read" → Message read by recipient
  5. "failed" → Message failed to deliver ❌

Important: "accepted" does NOT mean "delivered". It only means WhatsApp accepted your request.

Testing Webhook

tail -f storage/logs/laravel-$(date +%Y-%m-%d).log | grep "WhatsApp Webhook"

Expected logs when webhook works:

WhatsApp Webhook received
WhatsApp Message Status Update: status=delivered
WhatsApp Notification Log updated: status=delivered

Common Error Codes

Error Code Meaning Solution
131030 Recipient not in allowed list Add to test phone numbers list
131026 Template not found Verify template name and approval status
131047 Rate limit exceeded Wait and retry, or upgrade account tier
131051 Outside 24-hour window Use approved template
131048 Quality rating too low Improve messaging practices
10 Application does not have permission Update template format (e.g., DOCUMENT header)

Summary of WhatsApp Module Features

The WhatsApp module includes the following comprehensive features:

  • 29 Predefined Notification Templates: Complete set of templates organized by recipient type (Customer: 11, Admin: 5, Staff: 9, Delivery: 3, Automated: 1) covering all restaurant operations.
  • Event-Driven Notification System: Automatically sends notifications when orders, reservations, payments, and other events occur in TableTrack. No manual intervention required.
  • Template Management System: Easy-to-use admin panel for viewing template JSONs, mapping notification types to WhatsApp templates, and enabling/disabling individual notifications.
  • WhatsApp Business API Integration: Full integration with Meta's WhatsApp Business API including credential management, webhook configuration, and delivery status tracking.
  • Multi-language Support: Templates support multiple languages (en, hi, etc.) with language-specific template mappings.
  • Notification Logging and Tracking: Complete logging system tracks all sent notifications with delivery status (sent, delivered, read, failed) and error messages for troubleshooting.
  • Automated Scheduling: Scheduled commands for automated notifications including sales reports, payment reminders, reservation reminders, and follow-ups.
  • Queue System Integration: Uses Laravel's queue system for reliable message delivery and handling of bulk notifications with rate limit compliance.
  • Error Handling and Fallbacks: Graceful error handling with detailed logging. Failed notifications are logged and can be resent manually.
  • Compliance with WhatsApp Policies: Ensures compliance with WhatsApp Business API policies including template approval workflows, opt-in requirements, and 24-hour messaging windows.
  • Template Library: Pre-built template JSONs ready for copy-paste to WhatsApp Business Portal, with clear instructions and sample variables.
  • Per-Restaurant Configuration: Each restaurant can have its own WhatsApp Business API credentials and template mappings, allowing complete customization.
  • Notification Preferences: Fine-grained control over which notifications are sent to which recipient types (customer, admin, staff, delivery) per restaurant.

Notification Flow by Order Type

Dine-in Orders

  • Customer: Order confirmation notification
  • Admin: New order alert
  • Waiter: New order alert (if assigned)
  • Kitchen: KOT notification (via separate event)

Delivery Orders

  • Customer: Order confirmation notification
  • Admin: New order alert
  • Delivery Executive: New order alert (if assigned)
  • Kitchen: KOT notification (via separate event)

Pickup Orders

  • Customer: Order confirmation notification
  • Admin: New order alert
  • Kitchen: KOT notification (via separate event)

Important Notes

  • Template Approval: Templates must be approved by WhatsApp (24-48 hours) before they can be used. System handles pending templates gracefully.
  • Test Account Restrictions: Test accounts can only send to numbers in the allowed recipient list. Production accounts don't have this restriction.
  • Webhook Configuration: Webhook is required to receive delivery status updates. Must be publicly accessible via HTTPS.
  • Opt-in Compliance: Users must explicitly opt-in to receive WhatsApp messages. Ensure compliance with WhatsApp policies.
  • Queue Processing: If using database queue driver, ensure queue worker is running: php artisan queue:work
  • Rate Limits: WhatsApp has rate limits based on account tier. The module uses queuing to handle bulk notifications.
  • Phone Number Format: All phone numbers are formatted as phone_code + phone_number (no + sign, e.g., 919784921431)
  • Idempotency: Each order/reservation is processed only once (15-minute cache window) to prevent duplicate notifications.